Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix array_intersect #1039

Merged
merged 1 commit into from
Jun 15, 2020
Merged

fix array_intersect #1039

merged 1 commit into from
Jun 15, 2020

Conversation

luigifab
Copy link
Contributor

When there is no searchable attributes.

2020-06-12T08:41:42+00:00 DEBUG (7): Exception message: Warning: array_intersect(): Expected parameter 1 to be an array, null given in app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php on line 305

Copy link
Member

@colinmollenhour colinmollenhour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think _getSearchableAttributes should be modified to always return an array. Also it should set the cached value to an empty array to avoid multiple redundant queries if it is called multiple times.

@sreichel sreichel added bug Component: CatalogSearch Relates to Mage_CatalogSearch labels Jun 13, 2020
@luigifab
Copy link
Contributor Author

That's true. I updated my commit.

@colinmollenhour colinmollenhour merged commit 9b4207f into OpenMage:1.9.4.x Jun 15, 2020
@luigifab luigifab deleted the fulltext-array-intersect branch June 15, 2020 15:57
@sreichel
Copy link
Contributor

Question about syntax ... i remember a PR from last days where short array syntax was reverted.

Here we have $this->_searchableAttributes = []; ... hope nobody uses php5.3, but i know projects that still run 5.5/5.6 with a patched LTS install. If we introduce short array syntax, it should be consistent ... ;)

@sreichel sreichel added bug and removed review needed Problem should be verified labels Jun 15, 2020
@sreichel sreichel added this to the Release 19.4.4 milestone Jun 26, 2020
edannenberg pushed a commit to edannenberg/magento-lts that referenced this pull request Aug 20, 2020
…h_Model_Indexer_Fulltext::_getSearchableAttributes()
edannenberg pushed a commit to edannenberg/magento-lts that referenced this pull request Aug 24, 2020
…h_Model_Indexer_Fulltext::_getSearchableAttributes()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: CatalogSearch Relates to Mage_CatalogSearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants